package com.yangye.otherdemo.volatiledemo;

/**
 * Created by yangye on 2019/7/1
 */
public class TestDemo {

	volatile int volatileVar;


	void readAndWrite() {
		int tmp = volatileVar + 5;
		volatileVar = tmp * tmp;
	}

	public static void main(String[] args) {
		TestDemo demo = new TestDemo();
		demo.readAndWrite();
	}

}
